package com.x.erp.manage;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.x.erp.dao.CarSelectTemplateDao;
import com.x.erp.model.CarSelectTemplate;
import com.x.framework.manage.BaseManage;

/**
 * 车辆查询模板订阅服务
 * 
 * @author pansong
 *
 */
@Service
public class CarSelectTemplateManage extends BaseManage {

	@Autowired
	private CarSelectTemplateDao carSelectTemplateDao;
	/**
	 * 新增车辆查询模板订阅信息
	 * 
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public void insertCarSelectTemplate(CarSelectTemplate carSelectTemplate, List<CarSelectTemplate> list) throws Exception {
		//删除已有的订阅信息
		carSelectTemplate.setTemplateCreateTime(null);
		this.delete(carSelectTemplate);
		//添加订阅模板信息
		carSelectTemplateDao.insertCarSelectTemplate(carSelectTemplate, list);
	}
}
